
package pl.genapp.stocksense;

import pl.genapp.appsense.R;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;

public class NewsShowScreenFragment extends Fragment {
	
	private WebView	webview;
	private String	url;
	
	public static NewsShowScreenFragment newInstance(String url) {
		
		NewsShowScreenFragment fragment = new NewsShowScreenFragment();
		
		Bundle arg = new Bundle();
		arg.putString("url", url);
		
		fragment.setArguments(arg);
		
		return fragment;
		
	}
	
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		url = getArguments().getString("url");
	}
	
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		
		View layout = inflater.inflate(R.layout.fragment_news_show_screen, container, false);
		
		webview = (WebView) layout.findViewById(R.id.newsWebView);
		
		webview.getSettings().setJavaScriptEnabled(true);
		webview.loadUrl(url);
		
		return layout;
	}
	
}
